home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
gensmall.zip
/
VARFUNS.EXP
< prev
Wrap
Text File
|
1993-01-04
|
3KB
|
75 lines
***************************************************************
** This is a modification to the VARFUNS.TLB. Another parameter
** was added, "surr_quot," which places the correct quotation
** marks around a split string which will then be passed by the
** calling routine as a parameter surrounded by quotes.
**
** "surr_quot" is a parameter passed as ".t." if the calling function
** has quotation marks around the string to be built. This will
** make sure that the quotation marks are correct for Clipper.
**
** Modification 1) Line 18 - additional parameter
** Modification 2) Lines 46 through 51 Code to handle the
** Quotation marks if required.
** (John McCarvel 6-13-89)
***************************************************************
***************************************************************
function build_row_display_xpr
param b, absrow, surr_quot
private xpr ** we'll build the expression in here
private transv ** substring holder
private c, abscol ** column runners (relative & absolute)
private r ** row number relative to the box
private txt ** holds vtrans(field) rev#5
private xprlen ** current length of expression from previous linefeed rev #5
private outl ** 1 if outline box else 0 rev #5
r = absrow - b.top ** adjust the row number
xpr = ""
xprlen = 0 ** rev #5
outl = iif(b.outline.type,1,0) ** rev #5
c = outl
abscol = b.left + c
for all fields where field.owner = b .and. field.row = absrow
if field.col - abscol > 0
txt = digest_text(box_text(b, r, c, field.col-abscol))
xpr = xpr + "+" + txt ** rev #5
xprlen = xprlen + len(txt) + 1 ** rev #5
endif
txt = vtrans(field) ** rev #5
xprlen = xprlen + len(txt) + 1 ** Add 1 for "+" concatenation ** rev #5
if xprlen > 75 ** Line is getting full, needs a line continuation
** Clipper cannot continue inside a string ** rev #5
if pcount() > 2 .and. surr_quot = .t. ** rev #5 *JM
** Called from within a quote. *JM
xpr = xpr + "'+;%n'+" + txt ** rev #5 *JM
else *JM
xpr = xpr + " +;%n " + txt ** rev #5 *JM
endif *JM
xprlen = len(txt) ** rev #5
else
xpr = xpr + "+" + txt
endif
abscol = field.col + disp_len(field)
c = abscol - b.left
endfor
** some text or space betw. last field and right edge of box
if abscol <= b.right - outl
xpr = xpr + "+" + ;
digest_text(box_text(b, r, c, b.right-outl-abscol+1))
endif
** turn any single quotes into doubles. Sort of a sleaze, to allow
** calling function to double-quote returned string unconditionally.
strtran(xpr, "'", '"')
** return it -- also remove leading '+' from above
return xpr[2..len(xpr)]
**************************************************************************
*